package simple17.fruit;

import simple17.visit.Visit;

//苹果
public class Apple implements Fruit {
    private int price = 100;

    public Apple() {
    }

    public Apple(int price) {
        this.price = price;
    }


    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public void fruit() {
        System.out.print("苹果");
    }

    @Override
    public int price() {
        return price;
    }

    @Override
    public int accept(Visit visit) {//指针可以传递真实的类型
       return visit.sell(this);
    }
}
